package com.kaoshi.T22;

import java.util.Scanner;

/**
 * @author xiyu
 * @version 1.0
 * @date 2025/4/7 15:08
 * @description
 */
public class Test {
    static int az = 0;
    static int nums = 0;
    static int AZ = 0;
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.println("请输入一个字符串：");
        String next = input.next();
        gettypecount(next);
        System.out.println("a-z出现的次数："+az);
        System.out.println("A-Z出现的次数："+AZ);
        System.out.println("1-9出现的次数："+nums);
    }

    public static void gettypecount(String next) {
        char[] chars = next.toCharArray();
        for (char aChar : chars) {
            if (aChar>=97&&aChar<=122){
                az++;
            }
            if (aChar>=65&&aChar<=90){
                AZ++;
            }
            if (aChar>=48&&aChar<=57){
                nums++;
            }
        }
    }
}
